import request from '@/utils/request'

// 企业列表park/enterprise
export function getEnterpriseListAPI(params) {
  return request({
    url: '/park/enterprise',
    method: 'GET',
    params
  })
}

// 获取行业列表
export function getIndustryListAPI() {
  return request({
    url: '/park/industry'
  })
}

// 园区管理-添加/续租企业的租赁合同park/enterprise/rent
export function uploadAPI(data) {
  return request({
    url: '/upload',
    method: 'POST',
    data

  })
}

// 新增企业
export function createEnterpriseAPI(data) {
  return request({
    url: '/park/enterprise',
    method: 'POST',
    data
  })
}

// 新增企业
export function editEnterpriseAPI(data) {
  return request({
    url: '/park/enterprise',
    method: 'PUT',
    data
  })
}
// 查看企业详情
export function getEnterpriseDatailAPI(id) {
  return request({
    url: '/park/enterprise/' + id
  })
}

// 删除企业
export function deleteEnterpriseAPI(id) {
  return request({
    url: '/park/enterprise/' + id,
    method: 'DELETE'
  })
}

// 新增企业租赁合同
export function createRentAPI(data) {
  console.log(data)

  return request({
    url: '/park/enterprise/rent',
    method: 'POST',
    data
  })
}

// 获取当前合同列表
export function getRentListAPI(id) {
  return request({
    url: `/park/enterprise/rent/${id}`
  })
}

// 退租租赁合同/park/enterprise/rent/{id}
export function outRentAPI(id) {
  return request({
    url: '/park/enterprise/rent/' + id,
    method: 'PUT'
  })
}

// 查看企业
export function getLookRentAPI(id) {
  return request({
    url: '/park/enterprise/' + id
  })
}

// 删除企业的租赁合同/park/enterprise/rent/{id}
export function deleteRentAPI(id) {
  return request({
    url: '/park/enterprise/rent/' + id,
    method: 'DELETE'
  })
}
